<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改流程模型')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-MODEL-edit" th:object="${actReModel}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">流程分类：</label>
                <div class="col-sm-8">
                    <select name="category" th:field="*{category}" class="form-control m-b" th:with="type=${@dict.getType('process_category')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}"></option>
                    </select>

                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">流程名字：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">流程key：</label>
                <div class="col-sm-8">
                    <input name="key" th:field="*{key}" class="form-control" type="text" required>
                </div>
            </div>


            <!--<div class="form-group">
                <label class="col-sm-3 control-label">版本号：</label>
                <div class="col-sm-8">
                    <input name="version" th:field="*{version}" class="form-control" type="text">
                </div>
            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">流程描述：</label>
                <div class="col-sm-8">
                    <textarea name="metaInfo" class="form-control">[[*{metaInfo}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "process/model";
        $("#form-MODEL-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-MODEL-edit').serialize());
            }
        }

        $("input[name='lastUpdateTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>